package org.timeismoney.payment.service.impl;

import org.timeismoney.payment.model.Item;
import org.timeismoney.payment.service.ItemService;
import org.timeismoney.payment.service.ItemStuDetailService;
import org.timeismoney.payment.service.PaymentRecordService;

public class ItemServiceImpl extends BaseServiceImpl<Item, Integer> implements
		ItemService {
	private PaymentRecordService paymentRecordService;
	private ItemStuDetailService itemStuDetailService;
	
	public void setItemStuDetailService(ItemStuDetailService itemStuDetailService) {
		this.itemStuDetailService = itemStuDetailService;
	}

	public void setPaymentRecordService(PaymentRecordService paymentRecordService) {
		this.paymentRecordService = paymentRecordService;
	}
	
	@Override
	public void delete(Item e) {
		paymentRecordService.deleteByItemNo(e.getItemNo());
		itemStuDetailService.deleteAllByItemNo(e.getItemNo());
		super.delete(e);
	}

}
